Ethernet is currently the most widely-used communication standard of local area network and is gradually becoming the mainstream in wide area network technology.
In a large scale Ethernet, Ethernet switches are generally used to interconnect a plurality of Ethernets, as the effective transmission distance is limited.
In broadcast and multicast communications, the Ethernet switch has to ensure that a packet received at a port will not be transmitted out of the port received the packet; otherwise a broadcast storm will be caused. As illustrated in FIG. 1, an Ethernet switch A 11 is connected to an Ethernet switch B 12 and an Ethernet switch C 13 respectively. When a connection is established between the Ethernet switch B 12 and the Ethernet switch C 13, a loop is formed between the Ethernet switches A, B and C. Assuming a network connected to the Ethernet switch A 11 transmits a broadcast packet, the packet will be broadcasted to the Ethernet switches B 12 and C 13 by the Ethernet switch A 11. Upon receiving the packet, the Ethernet switch B 12 will broadcast the packet to networks connected thereto and the Ethernet switch C 13. The Ethernet switch C 13 will therefore receive repetitive packets. For the packet transmitted from the Ethernet switch A 11, the Ethernet switch C 13 will broadcast it to networks connected thereto and the Ethernet switch A 11. The Ethernet switch B 12 will again broadcast the received packet to the networks connected thereto and the Ethernet switch A 11. The process is repeated in such a way that a broadcast storm will be formed in the network.
As a result, the issue of Ethernet loop has always been of much concern for those skilled in the art. To reduce the risk of forming a loop, a STP (Spanning Tree Protocol) is generally deployed in the network. The basic concept of STP is to spread neighboring connections information acquired by each node across the network. All nodes in the whole network build up the network topology according to the information, and decide which links are working under redundant or backup state and therefore would not participate in packet forwarding, according to predetermined rules. In the case of determining that a certain link is faulty, it recalculates, according to the rules, which redundant or backup links will recover the active state and resume packet forwarding.
Conventional methods for loop detection mainly involve transmitting a special packet on a port of a device and then detecting whether the packet can be received from this port. The detection takes relatively long time as it requires operations, such as associated hand-shake protocols between devices. Furthermore, the conventional methods can only determine the existence of loop in the network while not able to determine in which part of the network the loop exists.